MAGIC equ 0x1badb002
FLAGS equ (1 << 0) | (1 << 1) | (1 << 6)
CHECKSUM equ -(MAGIC + FLAGS)

;; @todo: rewrite in FASM?

section .multiboot
dd MAGIC
dd FLAGS
dd CHECKSUM

;; @note: video modes

section .text
global entry
entry:
	mov esp, stack

	push ebx
	push eax

	extern kmain
	call kmain

global hang
hang:
	cli
	hlt
	jmp hang

section .bss
;; @note: GCC assumes the stack is 16-bit aligned because of the SysV ABI
;; https://wiki.osdev.org/System_V_ABI
align 16
resb 0x2000
stack:
